Skip to content

fix(omnivoice-gguf): find the bundled runtime from a staged app environment - #4053

Merged
debpalash merged 5 commits into
debpalash:mainfrom
b84330808:fix/gguf-bundled-bin-dir
Nov 13, 2026
Merged

debpalash merged 5 commits into
debpalash:mainfrom
b84330808:fix/gguf-bundled-bin-dir

Conversation

@b84330808

@b84330808 b84330808 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #4051. An installed app runs a copy of backend/ staged in its runtime folder (<app environment>/project), which has no bin/, while the installer keeps the OmniVoice GGUF runtime in resources/bin. The engine's <repo root>/bin lookup therefore reported the runtime as missing.

Changes

  • Desktop app passes resources/bin to the backend as OMNIVOICE_GGUF_BIN_DIR (same pattern as OMNIVOICE_FRONTEND_DIST); a value the user set wins.
  • The GGUF engine reads the binary and checksums.sha256 from that folder; source checkouts and store builds keep <repo root>/bin.
  • Docs: setup note and env-var row in docs/engines/omnivoice-gguf.md.

Type

  • 🐛 Bug fix

Testing

  • New test_installed_app_finds_the_runtime_outside_the_staged_backend fails before the fix ("GGUF binary missing …") and passes after.
  • New vitest cases in backend-setup.test.ts for the spawn env; the existing GGUF tests still pass.

The GGUF engine now reads its runtime directory from OMNIVOICE_GGUF_BIN_DIR when that variable holds an absolute path. The Electron main process sets it to the packaged resources/bin directory unless the user has already set a value, which addresses #4051, where a relocated project/ had no bin/ and the engine reported the runtime as missing. A relative OMNIVOICE_GGUF_BIN_DIR value is silently ignored and falls back to <repo root>/bin, so a reviewer should confirm that this silent fallback is acceptable.

…onment (debpalash#4051)

An installed app runs a copy of backend/ staged in its runtime folder
(<app environment>/project). That copy has no bin/, while the installer
keeps the GGUF runtime in resources/bin, so the engine's
`<repo root>/bin` lookup reported the runtime as missing.

The desktop app now passes resources/bin to the backend as
OMNIVOICE_GGUF_BIN_DIR, the same way it already hands over the web UI
(OMNIVOICE_FRONTEND_DIST). The backend reads the binary and
checksums.sha256 from that folder and keeps `<repo root>/bin` for
source checkouts and builds that run from resources/.
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

All contributors on this pull request have signed the VoiceStudio CLA. Thank you!

Agreement: VoiceStudio CLA 1.0

The opener has signed: CI and automated reviews are no longer on hold.

@github-actions
github-actions Bot marked this pull request as draft November 12, 2026 16:38
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The backend resolves the OmniVoice executable and checksum manifest from an absolute OMNIVOICE_GGUF_BIN_DIR, or from the repository bin/ directory otherwise. Packaged Electron launches provide the bundled resources/bin path when the setting is blank or unset.

Changes: GGUF runtime path

Layer / File(s) Summary
Backend binary directory resolution
backend/engines/omnivoice_gguf/backend.py, tests/backend/engines/test_omnivoice_gguf.py
The backend uses an absolute OMNIVOICE_GGUF_BIN_DIR for executable and checksum-manifest lookup. Unset or relative values use the repository bin/ directory. Tests cover configured, unset, and relative values.
Packaged runtime directory wiring
electron/src/main/backend.ts, electron/src/main/backend-setup.test.ts, tests/test_gguf_desktop_bundle.py, docs/engines/omnivoice-gguf.md, changelog.d/4053.fixed.md
Packaged Electron launches set the bundled resources/bin directory when the setting is blank or unset, and preserve a nonblank override. Tests check the managed runtime path. Documentation and the changelog describe the setting and runtime discovery fix.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: debpalash, velixio

Merge Risk: Minimal · up to 61760

This change lets installed apps find the bundled OmniVoice GGUF runtime in resources/bin. No remaining actionable merge-blocking risk was found. Source checkouts and store builds keep their existing lookup, and a user-set directory is preserved.

Pre-merge checks: Passed 8

Check name Status Explanation
Title check Passed The title uses the conventional-commit form with a scope, matching the required style. It states the main change: the engine finds the bundled runtime when the app runs from a staged environment. The …
Description check Passed The description follows the template's main sections: Summary, Changes, Type, and Testing. The Type section has the Bug fix box checked. The Testing section names the new backend test and the new Vite…
Linked Issues check Passed Issue #4051 asks that the relocated app environment include the GGUF runtime, or that the engine resolve it from the app resources directory. The reviewed head meets the second option. In `backend/eng…
Out of Scope Changes check Passed All changed files relate to the #4051 fix. backend.py adds BIN_DIR_ENV, _bin_dir(), and routes binary and manifest lookup through it. electron/src/main/backend.ts adds bundledGgufBinPath() a…
Cross-Platform Default Parity Passed The PR changes a default behavior: packaged desktop builds now set OMNIVOICE_GGUF_BIN_DIR to resources/bin when the variable is blank. The change does not diverge by platform. - `electron/src/main…
I18n Completeness (21 Locales) Passed The i18n completeness check does not apply to this pull request. The check covers new or changed t('...') keys in Electron UI code and hardcoded user-facing strings. Evidence: - The changed-file inven…
Local-First Guarantee Passed The PR adds no outbound calls, cloud dependencies, accounts, API keys, or analytics. The code diff is limited to local path resolution: - backend/engines/omnivoice_gguf/backend.py adds `BIN_DIR_ENV …
Backward Compatibility Passed PR #4053 (github.com/debpalash/VoiceStudio, author login b84330808) changes only how the OmniVoice GGUF runtime directory is located. The changed-file list has no database, schema, alembic, or omnivoi…
Full details: Title check

Explanation

The title uses the conventional-commit form with a scope, matching the required style. It states the main change: the engine finds the bundled runtime when the app runs from a staged environment. The title does not include the issue reference, but the requirement allows the reference in either the title or the body, and the body has "Fixes #4051". The title does not propose a version bump.

Full details: Description check

Explanation

The description follows the template's main sections: Summary, Changes, Type, and Testing. The Type section has the Bug fix box checked. The Testing section names the new backend test and the new Vitest cases. The description omits the template's checklist items, such as the changelog fragment and the CLA confirmation. The raw summary lists a changelog.d/4053.fixed.md fragment, so that item is covered in the diff. The description does not mention the regression fixture check, which applies only if runtime behavior changes. The description is mostly complete, so this check passes.

Full details: Linked Issues check

Explanation

Issue #4051 asks that the relocated app environment include the GGUF runtime, or that the engine resolve it from the app resources directory. The reviewed head meets the second option. In backend/engines/omnivoice_gguf/backend.py, the new _bin_dir() returns OMNIVOICE_GGUF_BIN_DIR when it is a non-blank absolute path, and &lt;repo root&gt;/bin otherwise. _binary_path() and _load_checksum_manifest() both call _bin_dir(), so the binary and checksums.sha256 resolve from the same directory. In electron/src/main/backend.ts, childEnv sets OMNIVOICE_GGUF_BIN_DIR to bundledGgufBinPath() (&lt;backendRoot&gt;/bin) when the app is packaged and the user has not set a non-blank value. The change matches the existing OMNIVOICE_FRONTEND_DIST pattern. The whole-PR diff confirms these hunks. The new Python and Vitest tests cover the env-var path. The issue's default, non-relocated environment is not checked, and the issue does not require that check. Test results were not run; the test coverage claims rest on the PR description and test summaries.

Full details: Out of Scope Changes check

Explanation

All changed files relate to the #4051 fix. backend.py adds BIN_DIR_ENV, _bin_dir(), and routes binary and manifest lookup through it. electron/src/main/backend.ts adds bundledGgufBinPath() and sets the env var in packaged builds. backend-setup.test.ts and tests/test_gguf_desktop_bundle.py cover the spawn env. tests/backend/engines/test_omnivoice_gguf.py covers the new lookup. The docs in docs/engines/omnivoice-gguf.md describe the variable. changelog.d/4053.fixed.md records the fix. These files support the objective and do not introduce unrelated behavior.

Full details: Cross-Platform Default Parity

Explanation

The PR changes a default behavior: packaged desktop builds now set OMNIVOICE_GGUF_BIN_DIR to resources/bin when the variable is blank. The change does not diverge by platform. - electron/src/main/backend.ts: the new guard is app.isPackaged &amp;&amp; process.resourcesPath &amp;&amp; !env.OMNIVOICE_GGUF_BIN_DIR?.trim(). It has no platform branch. bundledGgufBinPath() is join(backendRoot(), 'bin'), and backendRoot() returns process.resourcesPath for packaged apps on every OS. - backend/engines/omnivoice_gguf/backend.py: _bin_dir() applies the same rule on every OS. The only platform-keyed part is the binary name from _platform_slug() (.exe for Windows). That logic predates the PR. - electron/omnivoice-tts-bundle.mjs ships the runtime into resources/bin (or Contents/Resources/bin on macOS) with the same OMNIVOICE_TTS_RESOURCE_DIR. The PR does not change which platform slugs are bundled. Pre-existing, not introduced here: omnivoiceTtsSlug maps only win32 x64/arm64, darwin arm64 and linux x64. Darwin x64 and linux arm64 therefore get no bundled runtime. The PR does not change that mapping, so it is not a defect of this PR. Conclusion: the new default is applied identically on macOS, Windows and Linux. No platform-divergent default is introduced.

Full details: I18n Completeness (21 Locales)

Explanation

The i18n completeness check does not apply to this pull request. The check covers new or changed t('...') keys in Electron UI code and hardcoded user-facing strings. Evidence: - The changed-file inventory (refs/coderabbit/pre-merge-check/base..head) has 7 files. Only two are under electron/: electron/src/main/backend.ts and electron/src/main/backend-setup.test.ts. Both are main-process or test code, not renderer UI. - The only new t(-pattern matches in the Electron diff are it('...') Vitest test titles. They are not i18n calls. - backend.ts adds bundledGgufBinPath() and a childEnv assignment of OMNIVOICE_GGUF_BIN_DIR. Its new comment is developer-facing. No user-visible string is added. - The Python backend, docs, and changelog changes fall outside the Electron UI scope of this check. Both locale catalogs were confirmed to exist (22 entries each on disk). No new keys were added to them, so no locale file is missing a key. No hardcoded user-facing string was introduced.

Full details: Local-First Guarantee

Explanation

The PR adds no outbound calls, cloud dependencies, accounts, API keys, or analytics. The code diff is limited to local path resolution: - backend/engines/omnivoice_gguf/backend.py adds BIN_DIR_ENV = "OMNIVOICE_GGUF_BIN_DIR" and a _bin_dir() helper. _binary_path() and _load_checksum_manifest() now read from that directory. Both read local files only. - electron/src/main/backend.ts adds bundledGgufBinPath(), which returns join(backendRoot(), 'bin'). childEnv sets OMNIVOICE_GGUF_BIN_DIR for packaged builds only when the user has not set it. This sets an environment variable for the child process and makes no network call. A pattern search of all added non-Markdown lines (URLs, fetch/axios/requests/httpx, tokens/API keys, login/account, analytics/telemetry/consent, webhook/download) returned no matches. The changed files are the GGUF backend, the Electron backend and its test, a changelog fragment, docs, and tests. Consent and offline behavior are unchanged. The analytics consent flow is not touched. The runtime lookup is local, so the app keeps working offline with every prompt declined. CLAUDE.md and .github/CONTRIBUTING.md define the sanctioned outbound list. The PR does not add any entry to it.

Full details: Backward Compatibility

Explanation

PR #4053 (github.com/debpalash/VoiceStudio, author login b84330808) changes only how the OmniVoice GGUF runtime directory is located. The changed-file list has no database, schema, alembic, or omnivoice_data/ changes, and no model-weight or download-path changes. In backend/engines/omnivoice_gguf/backend.py, _bin_dir() returns OMNIVOICE_GGUF_BIN_DIR only when it is an absolute path. Otherwise it returns the unchanged _REPO_ROOT / "bin", so existing source checkouts and store builds resolve the same binary and manifest as before. The Electron change sets the variable only when it is blank, and a user-set value wins. No installed engine binary, checksum manifest, or downloaded weight needs to move, be re-downloaded, or be reinstalled. Existing voices, projects, and settings are not touched. The check passes.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5a019da and 617609c.

Files selected for processing: 2

  • backend/engines/omnivoice_gguf/backend.py
  • changelog.d/4053.fixed.md
Files skipped from review as they are similar to previous changes: 1

  • changelog.d/4053.fixed.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@greptile-apps

greptile-apps Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in Greptile

[Medium impact] This PR appears safe to merge.

Summary

The desktop app now tells the GGUF engine where its packaged runtime lives, so a staged backend can find it.

  • Installed apps now find the OmniVoice GGUF runtime.

Reviews (5) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

@b84330808

Copy link
Copy Markdown
Contributor Author

I have read the VoiceStudio CLA 1.0 and I hereby sign it.

github-actions Bot added a commit that referenced this pull request Nov 12, 2026
@github-actions
github-actions Bot marked this pull request as ready for review November 12, 2026 16:42
@github-actions github-actions Bot added the cla-signed Human contributors cleared by signed CLA v1.0 and the current PR CLA status. label Nov 12, 2026
@debpalash
debpalash merged commit 5cc6ff8 into debpalash:main Nov 13, 2026
37 checks passed

This branch was previously deployed

1 inactive deployment
external-pr — 617609ce Deployed Nov 13, 2026 by debpalash via Approve external pull request #10130
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed Human contributors cleared by signed CLA v1.0 and the current PR CLA status.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OmniVoice GGUF "missing" after moving the app environment: bin/ not present in relocated project/

2 participants